\hypertarget{class_zebulon_1_1_m_c_u_1_1_message_factory}{
\section{Zebulon::MCU::MessageFactory Class Reference}
\label{class_zebulon_1_1_m_c_u_1_1_message_factory}\index{Zebulon::MCU::MessageFactory@{Zebulon::MCU::MessageFactory}}
}


\hyperlink{class_zebulon_1_1_m_c_u_1_1_interface}{Interface} for dynamic creation of messages. This interface is used by the \hyperlink{class_zebulon_1_1_m_c_u_1_1_interface}{Interface} class when receiving new messages to de-\/serialize. Use this interface to add Custom MCU type messages for reading by the generic MCU \hyperlink{class_zebulon_1_1_m_c_u_1_1_interface}{Interface} class.  


{\ttfamily \#include $<$messagefactory.h$>$}\subsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{class_zebulon_1_1_m_c_u_1_1_message_factory_af4bded7bc2850a8896bfa71d7ef9c0f1}{
static void \hyperlink{class_zebulon_1_1_m_c_u_1_1_message_factory_af4bded7bc2850a8896bfa71d7ef9c0f1}{Initialize} ()}
\label{class_zebulon_1_1_m_c_u_1_1_message_factory_af4bded7bc2850a8896bfa71d7ef9c0f1}

\begin{DoxyCompactList}\small\item\em Adds the default messages (\hyperlink{class_zebulon_1_1_m_c_u_1_1_ping}{Ping}, \hyperlink{class_zebulon_1_1_m_c_u_1_1_pong}{Pong}, and \hyperlink{class_zebulon_1_1_m_c_u_1_1_query_report}{QueryReport}) to the factory. \item\end{DoxyCompactList}\item 
static \hyperlink{class_zebulon_1_1_m_c_u_1_1_message}{Message} $\ast$ \hyperlink{class_zebulon_1_1_m_c_u_1_1_message_factory_a30d1225c80f116a3e964ee167a3d55a2}{CreateMessage} (const \hyperlink{class_zebulon_1_1_m_c_u_1_1_message_a31e1f57be3ba6baa7fd656b776caea8f}{Message::Code} code)
\begin{DoxyCompactList}\small\item\em Creates a message based on the code passed. \item\end{DoxyCompactList}\item 
static int \hyperlink{class_zebulon_1_1_m_c_u_1_1_message_factory_ac62e5be920d837cb8691bb215e7b45ad}{AddToFactory} (\hyperlink{class_zebulon_1_1_m_c_u_1_1_message}{Message} $\ast$message)
\begin{DoxyCompactList}\small\item\em Adds a message to the Factory so new ones can be created. \item\end{DoxyCompactList}\item 
\hypertarget{class_zebulon_1_1_m_c_u_1_1_message_factory_a85d8a6b858bf78ac988057fedcd1a546}{
static void \hyperlink{class_zebulon_1_1_m_c_u_1_1_message_factory_a85d8a6b858bf78ac988057fedcd1a546}{Clear} ()}
\label{class_zebulon_1_1_m_c_u_1_1_message_factory_a85d8a6b858bf78ac988057fedcd1a546}

\begin{DoxyCompactList}\small\item\em Deletes all messages in the factory. \item\end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
\hyperlink{class_zebulon_1_1_m_c_u_1_1_interface}{Interface} for dynamic creation of messages. This interface is used by the \hyperlink{class_zebulon_1_1_m_c_u_1_1_interface}{Interface} class when receiving new messages to de-\/serialize. Use this interface to add Custom MCU type messages for reading by the generic MCU \hyperlink{class_zebulon_1_1_m_c_u_1_1_interface}{Interface} class. 

\subsection{Member Function Documentation}
\hypertarget{class_zebulon_1_1_m_c_u_1_1_message_factory_ac62e5be920d837cb8691bb215e7b45ad}{
\index{Zebulon::MCU::MessageFactory@{Zebulon::MCU::MessageFactory}!AddToFactory@{AddToFactory}}
\index{AddToFactory@{AddToFactory}!Zebulon::MCU::MessageFactory@{Zebulon::MCU::MessageFactory}}
\subsubsection[{AddToFactory}]{\setlength{\rightskip}{0pt plus 5cm}int MessageFactory::AddToFactory ({\bf Message} $\ast$ {\em message})\hspace{0.3cm}{\ttfamily  \mbox{[}static\mbox{]}}}}
\label{class_zebulon_1_1_m_c_u_1_1_message_factory_ac62e5be920d837cb8691bb215e7b45ad}


Adds a message to the Factory so new ones can be created. 
\begin{DoxyParams}{Parameters}
\item[\mbox{$\leftarrow$} {\em message}]\hyperlink{class_zebulon_1_1_m_c_u_1_1_message}{Message} to add to factory (takes ownership of pointer).\end{DoxyParams}
\begin{DoxyReturn}{Returns}
1 on success, 0 if a message with the same code already is added. 
\end{DoxyReturn}
\hypertarget{class_zebulon_1_1_m_c_u_1_1_message_factory_a30d1225c80f116a3e964ee167a3d55a2}{
\index{Zebulon::MCU::MessageFactory@{Zebulon::MCU::MessageFactory}!CreateMessage@{CreateMessage}}
\index{CreateMessage@{CreateMessage}!Zebulon::MCU::MessageFactory@{Zebulon::MCU::MessageFactory}}
\subsubsection[{CreateMessage}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Message} $\ast$ MessageFactory::CreateMessage (const {\bf Message::Code} {\em code})\hspace{0.3cm}{\ttfamily  \mbox{[}static\mbox{]}}}}
\label{class_zebulon_1_1_m_c_u_1_1_message_factory_a30d1225c80f116a3e964ee167a3d55a2}


Creates a message based on the code passed. 
\begin{DoxyParams}{Parameters}
\item[\mbox{$\leftarrow$} {\em code}]The message type to create.\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Pointer to newly created message, NULL if it hasn't been added to the factory. 
\end{DoxyReturn}


The documentation for this class was generated from the following files:\begin{DoxyCompactItemize}
\item 
C:/Users/Matt/Documents/School/Robotics/zebulon/v2/mcu/include/mcu/messagefactory.h\item 
C:/Users/Matt/Documents/School/Robotics/zebulon/v2/mcu/src/mcu/messagefactory.cpp\end{DoxyCompactItemize}
